package com.example.springboot;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @RestController 包括了以下注解：
 *      @Target({ElementType.TYPE})
 *      @Retention(RetentionPolicy.RUNTIME)
 *      @Documented
 *      @Controller
 *      @ResponseBody
 */
@RestController
@RequestMapping("/books")
public class web {
    //@GetMapping 作用相当于
    //@RequestMapping(method = RequestMethod.GET)
    @GetMapping
    public String getById(){
        System.out.println("springboot is running...");
        return "springboot is running..."; }
}
